

import erc20abi from "@/static/abi/erc20.json"
import routerabi from "@/static/abi/router.json"
import factoryabi from "@/static/abi/factory.json"
import pairercabi from "@/static/abi/pairerc.json"
import pairabi from "@/static/abi/pair.json"
import kualianabi from "@/static/abi/kualian.json"
import crossabi from "@/static/abi/cross.json"


const config = {
	swaprouter: "0xc210D1F40B5dEb3f1DC82a1E89788E9b9773795E",
	swapfactory: "0x7c4Db70dDF65713e815A5d9Fca0b2Db015AAA9aE",
	weth: "0x74Ee46a8E0B57aBC67C1E966DFB9948Bd9F927A0",
	approvenum: "115792089237316195423570985008687907853269984665640564039457584007913129639935",
	
	jumpusdt:"0x0c873B789f0890cCE0e5506C5454E9f142ca838E",
	jumpcross:"0x3FdE62eA364A94556b96b4F528E8820853dc20Ec",
	
	bscusdt:"0x55d398326f99059fF775485246999027B3197955",
	bsccross:"0x0c873B789f0890cCE0e5506C5454E9f142ca838E",
	
	tronusdt:"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
	troncross:"TXe992TwU5btj9xA21tND6xmrfMB2ReK1V",
	
	energprice:210,
	bandwidthprice:1000,
	
	
	

	erc20abi,
	routerabi,
	factoryabi,
	pairercabi,
	pairabi,
	crossabi
}
const methonds = {
	bigNumberTransform(value) {
		let param = {};
		let k = 10000,
			sizes = ['', '万', '亿', '万亿'],
			i;
		if (value < k) {
			param.value = value.toFixed(2)
			param.unit = ''
		} else {
			i = Math.floor(Math.log(value) / Math.log(k));
			param.value = ((value / Math.pow(k, i))).toFixed(2);
			param.unit = sizes[i];
		}
		return Number(param.value) + param.unit;
	},
	error(tip) {
		uni.hideLoading();
		uni.showToast({
			title: tip,
			position: "center",
			icon: "none",
			duration: 2000
		});
	},
	hideloading() {
		uni.hideLoading()
	},
	showloading() {
		uni.showLoading({
			title: "合约请求中",
			mask: true
		})
	},
}
export default {
	methonds,
	config
}